package product.service.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import product.service.model.ProductInfo;
import product.service.service.ProductService;

@RestController
@RequestMapping("/product")
public class ProductController {
    @Autowired
    ProductService productService;
    @RequestMapping("/{productId}")
    public ProductInfo getProduct(@PathVariable("productId") Integer id) {
        System.out.println("product-server接收到请求: " + id);
        return productService.getProductInfoById(id);
    }
}
